package com.piggy.logi.sys.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 订单状态枚举
 */
@Getter
@AllArgsConstructor
public enum GoodOrderStatusEnum {

    CANCEL(100, "取消", "取消"),

    NORMAL(110, "正常", "正常"),

    STATUS_UNKNOWN(-1, "未知状态", "未知状态"),

    ;

    private final int code;

    private final String info;

    private final String nextInfo;

    public static GoodOrderStatusEnum get(int code) {
        return Arrays.stream(GoodOrderStatusEnum.values()).filter(t-> t.getCode()== code).findFirst().orElse(STATUS_UNKNOWN);
    }

}
